package controller;

import model.MySql;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by yvdedu.com on 2016/9/28.
 */
@WebServlet(urlPatterns = "/sign_on")
public class sign_on extends HttpServlet{
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        MySql mySql=new MySql();
        if(req.getSession().getAttribute("user")!=null){
            String name= String.valueOf(req.getSession().getAttribute("user"));
            Boolean result=mySql.signOn(name);
            resp.getWriter().print(result);
        }
    }
}
